﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameManager : MonoBehaviour
{


    public int gameLevel = 1;
    private int hp = 100;
    private static GameManager _instance;
    private bool sleepStep = true;

    public List<Enemy> enemy = new List<Enemy>();
    
    
    public static GameManager Instance//单例模式
    {
        get
        {
            return _instance;
        }
    }

    // Start is called before the first frame update
    void Awake()
    {
        _instance = this;
    }

    public void HpReduce(int count)
    {
        hp -= count;
    }
    public void HpAdd(int count)
    {
        hp += count;
    }

    public void PlayerOnMove()
    {
        if (sleepStep == true)
        {
            sleepStep = false;
        }
        else
        {
            foreach (var item in enemy)
            {
                item.EnemyMove();
            }
            sleepStep = true;
        }

    }
}
